.class Lcom/TwinBlade/PicturePassword/au;
.super Ljava/lang/Thread;
.source "SourceFile"


# instance fields
.field final synthetic a:Lcom/TwinBlade/PicturePassword/Main;


# direct methods
.method constructor <init>(Lcom/TwinBlade/PicturePassword/Main;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    .line 265
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 5

    .prologue
    const/4 v4, -0x1

    .line 269
    new-instance v0, Ljava/io/File;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "/PPAData"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 270
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-nez v1, :cond_0

    .line 272
    :try_start_0
    invoke-virtual {v0}, Ljava/io/File;->mkdir()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    .line 276
    :cond_0
    :goto_0
    new-instance v0, Ljava/io/File;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "/PPAData"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "PPA-online-version.txt"

    invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 279
    :try_start_1
    new-instance v1, Ljava/net/URL;

    const-string v2, "http://dl.dropbox.com/u/73493117/PPA.inf"

    invoke-direct {v1, v2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    .line 281
    invoke-virtual {v1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v1

    .line 282
    invoke-virtual {v1}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v1

    .line 283
    new-instance v2, Ljava/io/BufferedInputStream;

    invoke-direct {v2, v1}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 284
    new-instance v1, Lorg/apache/http/util/ByteArrayBuffer;

    const/16 v3, 0x32

    invoke-direct {v1, v3}, Lorg/apache/http/util/ByteArrayBuffer;-><init>(I)V

    .line 286
    :goto_1
    invoke-virtual {v2}, Ljava/io/BufferedInputStream;->read()I

    move-result v3

    if-ne v3, v4, :cond_2

    .line 289
    new-instance v2, Ljava/io/FileOutputStream;

    invoke-direct {v2, v0}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 290
    invoke-virtual {v1}, Lorg/apache/http/util/ByteArrayBuffer;->toByteArray()[B

    move-result-object v1

    invoke-virtual {v2, v1}, Ljava/io/FileOutputStream;->write([B)V

    .line 291
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 295
    :goto_2
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 297
    :try_start_2
    new-instance v2, Ljava/io/BufferedReader;

    new-instance v3, Ljava/io/FileReader;

    invoke-direct {v3, v0}, Ljava/io/FileReader;-><init>(Ljava/io/File;)V

    invoke-direct {v2, v3}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V

    .line 300
    :goto_3
    invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_3

    .line 304
    invoke-virtual {v2}, Ljava/io/BufferedReader;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 309
    :goto_4
    :try_start_3
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    invoke-static {v0, v1}, Lcom/TwinBlade/PicturePassword/Main;->a(Lcom/TwinBlade/PicturePassword/Main;I)V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_3

    .line 313
    :goto_5
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-static {v0}, Lcom/TwinBlade/PicturePassword/Main;->d(Lcom/TwinBlade/PicturePassword/Main;)I

    move-result v0

    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-static {v1}, Lcom/TwinBlade/PicturePassword/Main;->c(Lcom/TwinBlade/PicturePassword/Main;)I

    move-result v1

    if-ge v0, v1, :cond_1

    .line 315
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-static {v0}, Lcom/TwinBlade/PicturePassword/Main;->c(Lcom/TwinBlade/PicturePassword/Main;)I

    move-result v0

    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-static {v1}, Lcom/TwinBlade/PicturePassword/Main;->b(Lcom/TwinBlade/PicturePassword/Main;)Landroid/content/SharedPreferences;

    move-result-object v1

    const-string v2, "IgnoreUpdateVersion"

    invoke-interface {v1, v2, v4}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v1

    if-eq v0, v1, :cond_1

    .line 316
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    .line 317
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/au;->a:Lcom/TwinBlade/PicturePassword/Main;

    invoke-static {v1}, Lcom/TwinBlade/PicturePassword/Main;->e(Lcom/TwinBlade/PicturePassword/Main;)Ljava/lang/Runnable;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 320
    :cond_1
    return-void

    .line 287
    :cond_2
    int-to-byte v3, v3

    :try_start_4
    invoke-virtual {v1, v3}, Lorg/apache/http/util/ByteArrayBuffer;->append(I)V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

    goto :goto_1

    .line 292
    :catch_0
    move-exception v1

    goto :goto_2

    .line 301
    :cond_3
    :try_start_5
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 302
    const/16 v0, 0xa

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_1

    goto :goto_3

    .line 305
    :catch_1
    move-exception v0

    goto :goto_4

    .line 273
    :catch_2
    move-exception v0

    goto/16 :goto_0

    .line 310
    :catch_3
    move-exception v0

    goto :goto_5
.end method
